Quản lý website giới thiệu và bán điện thoại di động ASP.net
19.337 lượt xem;
- dangky.aspx.cs
- project /
1 using System;
2 using System.Collections;
3 using System.Configuration;
4 using System.Data;
5 using System.Linq;
6 using System.Web;
7 using System.Web.Security;
8 using System.Web.UI;
9 using System.Web.UI.HtmlControls;
10 using System.Web.UI.WebControls;
11 using System.Web.UI.WebControls.WebParts;
12 using System.Xml.Linq;
13 using System.Data.OleDb;
14
15 public partial class dangky : System.Web.UI.Page
16 {
17 protected void Page_Load(object sender, EventArgs e)
18 {
19
20 }
21 protected void Button1_Click(object sender, EventArgs e)
22 {
23 try
24 {
25 if (txtemail.Text != "")
26 {
27 if ((txtemail.Text.LastIndexOf("@") != -1) && (txtemail.Text.LastIndexOf(".")) != -1)
28 {
29 if (txtpass.Text != "")
30 {
31 if (txtpass.Text == TextBox3.Text)
32 {
33 ado.ketNoi();
34
35 string query = "INSERT INTO tbluser VALUES('" + txtemail.Text + "','" + txtpass.Text + "','khach','" + txthoten.Text + "','" + txtdc.Text + "','" + txtdt.Text + "','" +
36 txtcmt.Text + "','" + txtnganhang.Text + "','" + txtmabuudien.Text + "')";
37 OleDbCommand cmd = new OleDbCommand(query, ado.con);
38 int i = cmd.ExecuteNonQuery();
39 if (i > 0)
40 Response.Redirect("dangkythanhcong.aspx", true);
41 ado.dongKetNoi();
42 }
43 else Lblthongbao.Text = "Xác nhận mật khẩu chưa đúng";
44
45 }
46 else Lblthongbao.Text = "Bạn chưa nhập vào mật khẩu";
47 }
48 else Lblthongbao.Text = "Email nhập chưa đúng";
49 }
50 else Lblthongbao.Text = "Bạn chưa nhập Email";
51 }
52 catch (Exception )
53 {
54
55 }
56 }
57 }
2 using System.Collections;
3 using System.Configuration;
4 using System.Data;
5 using System.Linq;
6 using System.Web;
7 using System.Web.Security;
8 using System.Web.UI;
9 using System.Web.UI.HtmlControls;
10 using System.Web.UI.WebControls;
11 using System.Web.UI.WebControls.WebParts;
12 using System.Xml.Linq;
13 using System.Data.OleDb;
14
15 public partial class dangky : System.Web.UI.Page
16 {
17 protected void Page_Load(object sender, EventArgs e)
18 {
19
20 }
21 protected void Button1_Click(object sender, EventArgs e)
22 {
23 try
24 {
25 if (txtemail.Text != "")
26 {
27 if ((txtemail.Text.LastIndexOf("@") != -1) && (txtemail.Text.LastIndexOf(".")) != -1)
28 {
29 if (txtpass.Text != "")
30 {
31 if (txtpass.Text == TextBox3.Text)
32 {
33 ado.ketNoi();
34
35 string query = "INSERT INTO tbluser VALUES('" + txtemail.Text + "','" + txtpass.Text + "','khach','" + txthoten.Text + "','" + txtdc.Text + "','" + txtdt.Text + "','" +
36 txtcmt.Text + "','" + txtnganhang.Text + "','" + txtmabuudien.Text + "')";
37 OleDbCommand cmd = new OleDbCommand(query, ado.con);
38 int i = cmd.ExecuteNonQuery();
39 if (i > 0)
40 Response.Redirect("dangkythanhcong.aspx", true);
41 ado.dongKetNoi();
42 }
43 else Lblthongbao.Text = "Xác nhận mật khẩu chưa đúng";
44
45 }
46 else Lblthongbao.Text = "Bạn chưa nhập vào mật khẩu";
47 }
48 else Lblthongbao.Text = "Email nhập chưa đúng";
49 }
50 else Lblthongbao.Text = "Bạn chưa nhập Email";
51 }
52 catch (Exception )
53 {
54
55 }
56 }
57 }